/*
 *                    BioJava development code
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  If you do not have a copy,
 * see:
 *
 *      http://www.gnu.org/copyleft/lesser.html
 *
 * Copyright for this code is held jointly by the individual
 * authors.  These should be listed in @author doc comments.
 *
 * For more information on the BioJava project and its aims,
 * or to join the biojava-l mailing list, visit the home page
 * at:
 *
 *      http://www.biojava.org/
 *
 * Created on 04.08.2004
 * @author Andreas Prlic
 *
 */


package org.biojava.services.das.registry ;

import java.util.*;
import java.net.*;

/** a simple wrapper bean to store the config information for DasClients */
public class DasClient {
	
	Map[] coordSysMap;
	String name;
	String iconPath;
	URL homepage;
	String description;

	public DasClient() { 
	}

	
	
	
	public String getDescription() {
		return description;
	}




	public void setDescription(String description) {
		this.description = description;
	}



	/** 
	 * @return nothing any more
	 * @deprecated
	 */
	public Map[] getCoordSysMap() {
		return coordSysMap;
	}

	/** set the coordinate system map 
	each coordinate system is linked to an activation string.
	e.g. a DasSource that serves in coordSys. <strong>name</strong> "PDBresnum,Protein Structure"
	can be activated in the SPICE client using:
	<strong>activatation URL</strong>
	http://das.sanger.ac.uk/registry/runspice.jsp?pdb=%testcode&amp;display=%id    
	<i>Note: the &amp; character needs to be URL encoded with &amp;amp;</i>

	The activation URL can contain special fields:
	<ul>
	<li>
		<strong>%id</strong> will be replaced with the unique ID of a DAS source.
	</li>
	<li>
		<strong>%testcode</strong> will be replaced with the testcode of a DAS source
	</li>
	</ul>
	 * @param map 
	 * @deprecated since March 2007. Please use AutoActivation instead
	 */
	public void addCoordSysMap(Map map) {
		if (coordSysMap == null ) {
			coordSysMap = new Map[1];
			coordSysMap[0] = map;
			return;
		}

		Map[] m =  new Map[coordSysMap.length+1];
		for (int i=0;i<coordSysMap.length;i++){
			m[i] = coordSysMap[i];
		}
		m[coordSysMap.length] = map;
		this.coordSysMap = m;
	}

	public void setHomepage(URL homepage){
		this.homepage = homepage;
	}

	public URL getHomepage() { return homepage; }


	/** set the Name of this DasClient 
	 * @param name */
	public void setName(String name) {
		this.name = name;
	}

	public String getName() { return name ;}

	/** the path to the image icon 
	 * @param path */
	public void setIconPath(String path) {
		this.iconPath = path;
	}

	public String getIconPath(){
		return iconPath;
	}

}
